<h1>管理日志</h1>

<table border="1">
  <tr>
    <th style="width: 8%">编号</th>
    <th style="width: 65%">标题</th>
    <th style="width: 15%">目录</th>
    <th>操作</th>
  </tr>

  <% @posts.each do |post| %>
    <tr>
      <td><%=h post.id %></td>
      <td><%= link_to post.title, post %></td>
      <td><%=h post.category_name %></td>
      <td><%= link_to_remote image_tag('edit.png',:title => '编辑'), :update => 'content', :method => :get, :url => edit_post_path(post) %>
        <%= link_to image_tag('delete.png',:title => '删除'), post, :confirm => 'Are you sure?', :method => :delete %></td>
    </tr>
  <% end %>
</table>

<br />

<%= link_to_remote '新建日志', :update => 'content', :method => :get, :url => new_post_path %>
